﻿using System;
using Microsoft.Win32;

namespace MediaBrowser.Gui.MvvmUtils.UI
{
    public class OpenFileDialogVisualizer : IOpenFileDialogVisualizer
    {
        public String ShowDialog(String defaultExt, String Filter)
        {
            String fileName = String.Empty;
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.DefaultExt = defaultExt;
            dlg.Filter = Filter;

            Nullable<bool> result = dlg.ShowDialog();

            if (result == true)
            {
                fileName = dlg.FileName;
            }
            return fileName;
        }
    }
}
